// 路径定义
require.config({
    baseUrl: '/',
    urlArgs: "v=20161122",
    waitSeconds: 0,
    shim: {
        // 非AMD模式，模块化定义，确定依赖和输出
        'tools': {
            deps: [
                'jquery'
            ],
            exports: 'tools'
        },
        'tools': {
            deps: ['jquery'],
            exports: 'tools'
        },
        'bootstrap':{
            deps: ['jquery']
        },
        'angular':{
            deps: ['jquery'],
            exports: 'angular'
        },
        'angular-route':{
            deps: ['angular'],
            exports: 'angular-route'
        },
        'angular-ui-router': {
            deps: ['angular'],
            exports: 'angular-ui-router'
        },
        'angular-grid':{
            deps: ['jquery','angular']
        },
        'angular-drag':{
            deps: ['jquery','angular']
        },
        'angular-bootstrap':{
            deps: ['angular','bootstrap']
        },
        'echarts':{
            exports: 'echarts'
        },
        'fixed-header':{
            deps: ['jquery']
        },
        "jquery.imgbox":{
            deps: [ "jquery" ]
        },
        "jquery.rotate":{
            deps: [ "jquery" ]
        },
        "jquery.cookie":{
            deps: [ "jquery" ]
        },
        "jquery.ui.core":{
            deps: [ "jquery" ]
        },
        "jquery.ui.widget":{
            deps: [ "jquery" ]
        },
        "jquery.ui.slide":{
            deps: [ "jquery" ]
        },
        "jquery.ui.datepicker":{
            deps: [ "jquery", "jquery.ui.core", "jquery.ui.widget", "jquery.ui.slide"]
        },
        "jquery.ui.datetimepicker":{
            deps: [ "jquery", "jquery.ui.datepicker" ]
        },
        "contractJs":{
            deps: [ "jquery", "contractCommonJs" ]
        }
    },
    paths: {
        // lib
        jquery: 'static/js/lib/jquery-1.11.2.min',
        bootstrap: 'static/js/lib/bootstrap',
        tools:'static/js/lib/tools-lib',
        text:'static/js/lib/text-min',
        template:'static/js/lib/template',

        angular:'static/js/lib/angular/angular.min',
        'angular-route':'static/js/lib/angular/angular-route.min',
        'angular-ui-router':'static/js/lib/angular/angular-ui-router.min',
        'angular-grid':'static/js/lib/angular/ng-grid.min',
        'angular-drag':'static/js/lib/angular/angular-drag',
        'angular-bootstrap':'static/js/lib/angular/ui-bootstrap-tpls.min',
        'angular-local-zh-cn':'static/js/lib/angular/ui-locale_zh-cn',

        moment:'static/js/lib/moment',
        echarts:'static/js/lib/echarts-all',
        "fixed-header":"static/js/plugin/table-fixed-header",

        "jquery.rotate":'static/js/lib/jquery-rotate',
        "jquery.imgbox":"static/js/lib/jquery.imgbox",
        "jquery.cookie":"static/js/lib/jquery.cookie",
        "jquery.ui.core":"static/js/lib/datetimepicker/jquery.ui.core",
        "jquery.ui.widget":"static/js/lib/datetimepicker/jquery.ui.widget",
        "jquery.ui.slide":"static/js/lib/datetimepicker/jquery-ui-slide.min",
        "jquery.ui.datepicker":'static/js/lib/datetimepicker/jquery.ui.datepicker',
        "jquery.ui.datetimepicker":'static/js/lib/datetimepicker/jquery-ui-timepicker-addon',

        "contractCommonJs": "js/CommonJs",
        "contractJs": "contract/js/contract",

        "store":"static/js/lib/store.min",
        "config":'js/config',
        "geo":'js/plugins/geo',
        "app":'js/app'
    }
});

var body = document.body||document.getElementsByTagName("body")[0],pageJs,pageJsPrefix="";
pageJs = body&&body.getAttribute("data-js")?body.getAttribute("data-js"):"";
if(pageJs.length){
    var arr=pageJs.split(" ");
    for(var i=0;i<arr.length;i++){
        arr[i]=arr[i].indexOf(".js")==-1?(pageJsPrefix+arr[i]+".js"):pageJsPrefix+arr[i];
    }
    require([arr.join(",")],function(){});
}
